<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/include/taglibs.jsp"%>

<style type="text/css">
body {
	background-image: url(../images/mainframe-bg.jpg);
	background-repeat: repeat-x;
	margin: 0px auto;
	padding: 0px;
	position: relative;
	text-align: center;
}
</style>

<script language="javascript">
<!--
function senfe(o,a,b,c,d){
var t=document.getElementById(o).getElementsByTagName("tr");
for(var i=0;i<t.length;i++){
t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
t[i].onclick=function(){
if(this.x!="1"){
this.x="1";//本来打算直接用背景色判断，FF获取到的背景是RGB值，不好判断
this.style.backgroundColor=d;
}else{
this.x="0";
this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
}
}
$(t[i]).mouseover(function(){
if(this.x!="1")this.style.backgroundColor=c;
});
$(t[i]).mouseout(function(){
if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
});
}
}
$(document).ready(function (){
	//senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
	senfe("t_user","#e5f1f4","#f8fbfc","#ecfbd4","#bce774");
});
--></script>

<script type="text/javascript">
function doDelete(id){
	var prompt = "确实要删除此区局吗？";
	if(window.confirm(prompt)){
		document.location.href = "<%=request.getContextPath()%>/common.regionnavi.do?action=delete&id="+id;
	}
}

function doSeleDelete(){  
	var prompt = "确实要删除选择用户吗？";	
	if(window.confirm(prompt)){
		var url_str = "<%=request.getContextPath()%>/common.regionnavi.do?action=delete&rnd"+Math.random();
		frmList.action = url_str;		
		frmList.submit();	
	}
}

function search(){			
   frmList.submit();	
}

function toRefresh(){
	var qname =document.getElementById("queryRobotName").value;
	window.location.href="common.realtimequery.do?queryRobotName="+qname;
} 

</script>

<div >
<div style="text-align: left; color: red"><html:errors /></div>


<form id="frmList" action="common.realtimequery.do" method="post" >
<table width="100%" border="0" cellpadding="3" cellspacing="0"
	class="sanxuan" style="background-repeat: repeat;">
	<tbody>
		<tr>
			<td height="31" width="900px"
				style="font-size: 14px; color: white; text-align: center">&nbsp;区域查询</td>
		</tr>
		<tr>
			<td>
			<table border="0" width="95%" align="center">
				<tr align="left">
					<td><strong>设备名称 :</strong>
						<input name="queryRobotName" id="queryRobotName"  style ="width:125px"  value="${queryRobotName}">
					</td>										
					<td align="left">
					<img src="<%=request.getContextPath() %>/images/table/chaxun.gif" width="90" height="30" style="cursor:hand;" onclick="javascript:search();"/>					
					</td>
				</tr>
			</table>
			</td>
		</tr>
	</tbody>
</table>
<br>
<div> <strong >页面刷新时间： </strong> <select id ="refreshtime" name="refreshtime"><option value="10"> 10 秒</option>
<option value="5"> 5 秒</option><option value="20"> 20 秒</option><option value="60"> 60 秒</option> </select> <div>
<table width="100%" cellpadding="4" class="liebiao" id="t_region"
	align="center">
	<thead>
		<tr>			
			<td>区域名称</td>	
			<td>设备名称</td>
			<td>设备时间</td>	
			<td>丢包概率</td>	
			<td>服务质量</td>
			<td>源地址</td>
			<td>源端口</td>
			<td>目的地址</td>
			<td>目的端口</td>
			<td>RtpLost</td>
			<td>Rtpse</td>
			<td>DF</td>
			<td>MDIMLR</td>
			<td>BitRate</td>
			<td>%PortBitRate</td>
			<td>音量</td>
			<td>电压</td>	
						
		</tr>
	</thead>
	<tbody>
		<c:forEach var='vo' items="${RA_PAGER_ITEMS}" varStatus="vs">
			<tr>
				<td class="list-value">${vo.robotManage.regionManage.regionName}</td>
				<td class="list-value">${vo.robotManage.name}</td>	
				<td class="list-value">${vo.qosRecord.logTimeStr}</td>				
				<td class="list-value">${vo.currLostRate}</td>
				<td class="list-value">${vo.currQuality}</td>
				<td class="list-value">${vo.qosRecord.srcIp}</td>
				<td class="list-value">${vo.qosRecord.srcPort}</td>
				<td class="list-value">${vo.qosRecord.destIp}</td>
				<td class="list-value">${vo.qosRecord.destPort}</td>
				<td class="list-value">${vo.qosRecord.rtplost}</td>
				<td class="list-value">${vo.qosRecord.rtpse}</td>
				<td class="list-value">${vo.qosRecord.df}</td>
				<td class="list-value">${vo.qosRecord.mdimlr}</td>
				<td class="list-value">${vo.qosRecord.bitRate}</td>
				<td class="list-value">${vo.qosRecord.portBitRate}%</td>
				<td class="list-value">${vo.qosRecord.volume}</td>
				<td class="list-value">${vo.qosRecord.power}</td>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
	</tfoot>
</table>
<br/>
<div class="pagenav"><jsp:include page="/include/pager.jsp"
	flush="true" /></div>	
</form>
</div>
<script type="text/javascript">
var st = new SortableTable( document.getElementById("t_region"), ["None", "String" ,"None"],'#E4EEF7','white','#FF9900');

var time =document.getElementById("refreshtime").value;

//*定时更新页面
window.setInterval("toRefresh()", eval(time*1000));
	
</script>



